Skip to content

Clean up lingering clusters after test runs#144

Merged
danielfrankcom merged 1 commit intomainfrom
feat/shared-cluster-cleanup
May 16, 2025
Merged

Clean up lingering clusters after test runs#144
danielfrankcom merged 1 commit intomainfrom
feat/shared-cluster-cleanup

Conversation

@danielfrankcom
Copy link
Copy Markdown
Contributor

@danielfrankcom danielfrankcom commented May 16, 2025

This PR fixes #136

This change introduces a script to clean up lingering clusters. It only applies to clusters that are not already deleting, and which have the correct Repo tag. The script also exits early if the IS_CI flag isn't set for additional safety.

The clean-clusters.yml workflow can be called to clean up the clusters generated by other workflows.o

Things needed before review:

  • Use latest AWS CLI version. Current one in workflow isn't showing the tags properly which breaks the script. Maybe add a sanity check for the minimum version to the script. This is a bit complicated in Bash so I won't bother for now
  • Modify other workflow files to reference this shared implementation
  • Remove duplicate implementations in language test suites

By submitting this pull request, I confirm that my contribution is made under the terms of the MIT-0 license.

@danielfrankcom danielfrankcom force-pushed the feat/shared-cluster-cleanup branch 2 times, most recently from f0250bb to f71a91e Compare May 16, 2025 19:26
@mitchell-elholm
Copy link
Copy Markdown
Contributor

Will this include a name parameter to filter clusters to delete? Or will it just be the repo tag?

@danielfrankcom
Copy link
Copy Markdown
Contributor Author

Will this include a name parameter to filter clusters to delete? Or will it just be the repo tag?

My intention is just the repo tag. We could add a name parameter if we wanted but I'm not sure it's necessary with the way the examples are defined at the moment. It would also be a bit complicated for Go since the name is dynamic and includes the workflow run ID or something.

@danielfrankcom danielfrankcom force-pushed the feat/shared-cluster-cleanup branch 2 times, most recently from 41cafe4 to 9827a9d Compare May 16, 2025 20:25
@danielfrankcom
Copy link
Copy Markdown
Contributor Author

This is a successful run of the cleanup script which shows what it does when actually deleting things. I stacked the Rust account with various types and states of leftover clusters before this run to give the script something to do.

@danielfrankcom danielfrankcom force-pushed the feat/shared-cluster-cleanup branch 4 times, most recently from 12921af to 2e2bedd Compare May 16, 2025 21:36
@danielfrankcom danielfrankcom marked this pull request as ready for review May 16, 2025 22:27
Comment thread .github/scripts/clean-clusters.sh Outdated
Comment thread .github/workflows/python-cm-integ-tests.yml
Comment thread .github/scripts/clean-clusters.sh
Comment thread .github/workflows/cpp-cm-integ-tests.yml
@danielfrankcom danielfrankcom force-pushed the feat/shared-cluster-cleanup branch from 2e2bedd to da6531e Compare May 16, 2025 22:52
@danielfrankcom danielfrankcom merged commit 2e3e103 into main May 16, 2025
20 checks passed
@wcmjunior wcmjunior deleted the feat/shared-cluster-cleanup branch May 16, 2025 23:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Portable cluster_management cleanup

3 participants